#include<stdio.h>
int main()
{
	int function(int year, int month, int day );
	int year,month,day,bujili=0;
	day=13;
	scanf("%d",&year);
	for(month=1;month<=12;month++)
	{
		if((function(year,month,day)-1)%7==1)
		{
			bujili+=1;
		}	
	}
	printf("%d",bujili);
	return 0;
}
int function(int year,int month,int day)
{
	int sum,i,j,leap,monthday,sum1=0,sum2,leapday=0;
	if((year%4==0&&year%100!=0)||year%400==0)
	leap=1;
	else
	leap=0;
	for(i=1;i<month;i++)
	{
		if(i==2)
		monthday=28+leap;
		else if(i==1||i==3||i==5||i==7||i==8||i==10||i==12)
		monthday=31;
		else
		monthday=30;
		sum1+=monthday;
	}
	sum2=sum1+day;
	for(j=year-1;j>1998;j--)
	{
		if((j%4==0&&j%100!=0)||j%400==0)
		leapday+=1;
	}
	sum=sum2+(year-1998)*365+leapday;
 	return sum;
  }
